<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script language="javascript" type="text/javascript" src="http://manager.zyttb.com/Public/Manage/Js/jquery.js"></script>
<script src="http://manager.zyttb.com/Public/Manage/Js/frame.js" language="javascript" type="text/javascript"></script>
<link href="http://manager.zyttb.com/Public/Manage/Css/style.css" rel="stylesheet" type="text/css" />

<!--[if IE 6]>
<script src="http://manager.zyttb.com/Public/Manage/Js/DD_belatedPNG.js" language="javascript" type="text/javascript"></script>
<script>
  DD_belatedPNG.fix('.nav ul li a,.top_link ul li,background');   /* string argument can be any CSS selector */
</script>
<![endif]-->
</head>
<body class="showmenu">
<style type="text/css">
    .layui-layer-tips{width:auto !important;}
</style>
<script src="http://manager.zyttb.com/Public/Manage/Js/common.js" type="text/javascript"></script>
<script src="/Public/Layer/layer.js" type="text/javascript"></script>
<script src="/Public/DatePicker/DatePicker.js" type="text/javascript"></script>
<link href="/Public/DatePicker/Css/DatePicker.css" type="text/css" rel="stylesheet" />
<table width="100%" height="31px" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
    <tr>
        <td height="31"><div class="titlebt">交易记录查询</div></td>
    </tr>
</table>

<div class="main">
    <div class="operate">
        <div class="left_pad">
            <form id="search" method="get" action="<?php echo U('Finance/TradingRecords');?>">
                <!-- 筛选 -->
                <label>
                交易平台：
                <select name="platform">
                    <option value="0" selected>全部</option>
                    <?php if(is_array($platforms)): $i = 0; $__LIST__ = $platforms;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i; if($v['platform_id'] == $_GET['platform']): ?><option value="<?php echo ($v["platform_id"]); ?>" selected="selected"><?php echo ($v["platform_name"]); ?></option>
                            <?php else: ?>
                            <option value="<?php echo ($v["platform_id"]); ?>"><?php echo ($v["platform_name"]); ?></option><?php endif; endforeach; endif; else: echo "" ;endif; ?>
                </select>
                </label>

                <label>
                交易币种：
                <select name="currency">
                    <option value="0" selected>全部</option>
                    <?php if(is_array($currency)): $i = 0; $__LIST__ = $currency;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i; if($v['common_class_id'] == $_GET['currency']): ?><option value="<?php echo ($v["common_class_id"]); ?>" selected="selected"><?php echo ($v["common_class_name"]); ?></option>
                            <?php else: ?>
                            <option value="<?php echo ($v["common_class_id"]); ?>"><?php echo ($v["common_class_name"]); ?></option><?php endif; endforeach; endif; else: echo "" ;endif; ?>
                </select>
                </label>

                <label>
                交易类型：
                <select name="trade_type">
                    <option value="0" selected>全部</option>
                    <?php if(is_array($tradeType)): $i = 0; $__LIST__ = $tradeType;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i; if($v['common_class_id'] == $_GET['trade_type']): ?><option value="<?php echo ($v["common_class_id"]); ?>" selected="selected"><?php echo ($v["common_class_name"]); ?></option>
                            <?php else: ?>
                            <option value="<?php echo ($v["common_class_id"]); ?>"><?php echo ($v["common_class_name"]); ?></option><?php endif; endforeach; endif; else: echo "" ;endif; ?>
                </select>
                </label>

                <label>交易时间：<input type="text" class="inp_default" style="width:180px; text-align: center;" name="date" id="datePicker" readonly /></label>

                <input type="text" name="keyword" title="关键字" class="inp_default" value="<?php echo ($_GET['keyword']); ?>" placeholder="请输入流水号/交易主体用户名">
                <input type="hidden" name="cid" id="cid"/>
                <p>
                    <a href="<?php echo U('Finance/csv',array('rand'=>rand(1000,9999)));?>" class="btn_blue" style="display:block;float: right;color: #fff;text-decoration: none;">导出交易记录</a>
                    <input type="submit" class="btn_blue" value="查  询" style="float: right;">
                </p>
                <script type="text/javascript">
                    var dateRange1 = new pickerDateRange('datePicker', {
                                isTodayValid: true,
                                aToday: 'aTodayDemo1', //今天
                                aRecent30Days: 'aRecent30DaysDemo1', //最近30天
                                aRecent90Days: 'aRecent90DaysDemo1', //最近90天
                                aRecent1Year: 'aRecent1YearDemo1',//最近1年
                            <?php if(empty($start)): ?>startDate: '<?php echo date('Y-m-d', time()-2592000);?>',
                            endDate: '<?php echo date('Y-m-d', time());?>',
                    <?php else: ?>
                    startDate: '<?php echo ($start); ?>',
                            endDate:   '<?php echo ($end); ?>',<?php endif; ?>
                    needCompare: false,
                            target: 'searchForm',
                            defaultText: ' ~ ',
                            autoSubmit: true,
                            inputTrigger: 'datePicker',
                            theme: 'ta',
                            magicSelect: false,
                    });
                </script>
            </form>
        </div>
    </div>
    <div class="list">



            <table width="100%">
                <tr>
                    <!--<th><input  name="chkall" type="checkbox" id="chkall" onClick="selectall(this.form)"></th>-->
                    <th>交易流水号</th>
                    <th>交易日期</th>
                    <th>交易平台</th>
                    <th>交易币种</th>
                    <th>交易类型</th>
                    <th>交易金额</th>
                    <th>交易主体</th>
                    <th>交易客体</th>
                    <th>交易说明</th>
                </tr>

                <?php if(empty($list)): ?><tr>
                        <td colspan="9">本区域暂无数据显示...</td>
                    </tr>
                    <?php else: ?>
                    <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><tr>
                            <td><?php echo ($v["money_log_no"]); ?></td>
                            <td><?php echo (date("Y-m-d H:i:s",$v["money_log_time"])); ?></td>
                            <td><?php echo ($v["platform_name"]); ?></td>
                            <td><?php echo ($v["currency"]); ?></td>
                            <td><?php echo ($v["common_class_name"]); ?></td>
                            <td>
                                <?php if($v['money_log_count'] < 0): ?><span class="red"><?php echo (price($v["money_log_count"],false)); ?></span>
                                    <?php else: ?>
                                    <span class="green" style="color: #718c00;"><?php echo (price($v["money_log_count"],false)); ?></span><?php endif; ?>
                            </td>
                            <td><?php echo ($v["master"]); ?></td>
                            <td><?php echo ($v["slave"]); ?></td>
                            <td><?php echo ($v["money_log_desc"]); ?></td>
                        </tr><?php endforeach; endif; else: echo "" ;endif; endif; ?>


            </table>
    </div>

    <div id="page-list" style="text-align: center"></div>

</div>

<script type="text/javascript" src="/Public/Layerpage/laypage.js"></script>
<script type="text/javascript">
    laypage({
        cont: 'page-list',
        pages: <?php echo ($pages); ?>,
        first: 1,
        last: <?php echo ($pages); ?>,
        prev: '<',
        next: '>',
        curr: function(){
            var page = location.search.match(/page=(\d+)/);
            return page ? page[1] : 1;
        }(),
        jump: function(e, first){ //
            if(!first){
                location.href = page() + e.curr;
            }
        }
    });

    function page(){
        var u = location.href;
        var r = '';
        if(u.indexOf('&') > 0){
            r = location.href.replace(/&page=\d+/, '');
            return r + '&page=';
        }else if(u.indexOf('?') > 0 ){
            if(u.indexOf('?page') > 0 ){
                r = location.href.replace(/\?page=\d+/, '');
                return r + '?page=';
            }else{
                return location.href + '&page=';
            }
        }else{
            return location.href + '?page=';
        }
    }
</script>
</body>
</html>